.modal-header
    h4.modal-title
        span(ng-if="!env.id") New Environment
        span(ng-if="env.id") Edit Environment

.modal-body
    form.form-horizontal
        label.control-label Environment Name
        input.form-control(type="text" ng-model="env.name" placeholder="Friendly name to identify your environment")

        label.control-label Environment (This has to be a JSON object)
        div(ui-ace="{mode: 'json', workerPath: '/public/js/ace/'}" class="form-control" style="height: 200px" ng-model="env.json")
        p.help-block
            | Must be valid JSON.
            | You may use the key ENV to pass a json object which sets environmental
            | variables for the ansible command execution environment

.modal-footer
    button.btn.btn-default.pull-left(ng-click="$dismiss()") Dismiss
    button.btn.btn-danger(ng-click="$close({ remove: true })") Delete
    button.btn.btn-success(ng-click="$close({ environment: env })")
        span(ng-if="!env.id") Create
        span(ng-if="env.id") Update
